clear all
set maxvar 32767
*cd "set directory where data is stored"
use Table1


****Creating the key dependent variables
****Perceptions on Nation Identity and Ethnic Favoritism
*****1st outcome Ethnic Identity
gen Identity_National=.
replace Identity_National=1 if Q83==4|Q83==5
replace Identity_National=0 if Q83==1|Q83==2|Q83==3


****2nd outcome No Ethnic Favoritism
gen group_treated_fair=.
replace group_treated_fair=1 if Q82==0 
replace group_treated_fair=0 if Q82==1|Q82==2|Q82==3








*****TABLE 1 - Language repertoires and national cultures

areg Identity_National i.COUNTRY  sopiuimc_OC sopiuimc_NC Q1 Q2 i.Q89 i.Q90 Q101 i.Q102 Q92A Q92B Q92C URBRUR if  (Q1>=0 & Q1<=110) & (Q2>=0 & Q2<=1) & (Q89>=0 & Q89<=15) & (Q90>=0 & Q90<=995) ///
& Q102>=0 & (Q92A>=0 & Q92A<=1) & (Q92B>=0 & Q92B<=1) & (Q92C>=0 & Q92C<=1)  & Q3>0  [w=Combinwt], absorb(Q3)

outreg2 using afro.tex, stats(coef se) auto(2)  keep(  sopiuimc_OC sopiuimc_NC) paren(se) bracket (ci) level(95) label replace



areg group_treated_fair i.COUNTRY sopiuimc_OC sopiuimc_NC Q1 Q2 i.Q89 i.Q90 Q101 i.Q102 Q92A Q92B Q92C URBRUR if  (Q1>=0 & Q1<=110) & (Q2>=0 & Q2<=1) & (Q89>=0 & Q89<=15) & (Q90>=0 & Q90<=995) ///
& Q102>=0 & (Q92A>=0 & Q92A<=1) & (Q92B>=0 & Q92B<=1) & (Q92C>=0 & Q92C<=1)  & Q3>0 [w=Combinwt], absorb(Q3)
outreg2 using afro.tex, stats(coef se ) auto(2)  keep(  sopiuimc_OC sopiuimc_NC) paren(se) bracket (ci) level(95) label append
